<template>
	<u-tabbar :fixed="true" :placeholder="true" :safeAreaInsetBottom="true" @change="getRouterPath">
		<u-tabbar-item v-for="(item, index) in getTabBarInfo" :key="item.uid" :text="item.text" :name="item.name"
			:icon="item.icon" />
	</u-tabbar>
</template>

<script>
	import tabBarInfo from '@/common/tabBarInfo'
	export default {
		name: "mainTabBar",
		data() {
			return {
				pathUrl: ''
			};
		},
		computed: {
			getTabBarInfo() {
				return tabBarInfo;
			}
		},
		methods: {
			getRouterPath(e) {
				tabBarInfo.forEach(item => {
					// uni.$u.route({})
					// 参数类型对象
					// type属性默认为 type: 'navigateTo',
					if (item.name === e) uni.$u.route(item.url);
				})
			}
		}
	}
</script>

<style>

</style>
